﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3
{
    public partial class WebForm12 : System.Web.UI.Page
    {
        private DataClassesHealthDataContext dc = new DataClassesHealthDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string idcp = Request.QueryString["idcp"];
                if (idcp == null)
                {
                    Response.Redirect("policydetails.aspx");
                }
                else
                {
                    CompanyDetail comp = this.dc.CompanyDetails.Single(cp => cp.companyid.Equals(idcp));
                    this.LabelName.Text = comp.companyname;
                    this.LabelAddress.Text = comp.address;
                    this.LabelPhone.Text = comp.phone;
                    this.LabelURL.Text = comp.companyurl;
                }
            }
        }

        protected void ButtonCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("policydetails.aspx");
        }
    }
}